{include file="index/_meta" /}
    <title>资讯详情</title>
<style>
    pre{
        white-space: pre-wrap;/* css-3 */
        white-space: -moz-pre-wrap;/* Mozilla, since 1999 */
        white-space: -pre-wrap;/* Opera 4-6 */
        white-space: -o-pre-wrap;/* Opera 7 */
        word-wrap: break-word; /* Internet Explorer 5.5+ */
        word-break:break-all;
        overflow:hidden;
        color: #777777; /*字体颜色*/
    }
</style>
</head>
<body>
    <div id="app">
        <van-nav-bar
                title="资讯详情"
                left-text="返回"
                left-arrow
                @click-left="window.history.back();"
        ></van-nav-bar>

        <van-cell center>
            <template #title>
                作者：{{info.user_nickname}}
            </template>
            <template #default>
                点击量: {{info.click_num}}
            </template>
            <template #label>
                时间：{{info.create_time}}
            </template>
        </van-cell>

        <van-cell center>
            <template #title>
                地址：{{info.address_full}}
            </template>
            <template #label>
                {{info.address}}
            </template>
        </van-cell>

        <van-cell center>
            <template #title>
                联系人：{{info.contact_name}}
            </template>
            <template #default>
                联系方式: <a :href="'tel'+info.contact_phone">{{info.contact_phone}}</a>
            </template>
        </van-cell>

        <div style="padding-left: 10px;padding-right: 10px;">
            <pre>{{info.content}}</pre>
        </div>

    </div>
<script>
    new Vue({
        el: "#app",
        data() {
            return {
                forum_id:"{$Think.get.forum_id}",
                info:{},
            }
        },
        created(){
            this.getForumDetail()
        },
        methods:{
            getForumDetail(){
                let that = this
                axios.post("{:url('forum/getForumDetail')}",{
                    forum_id:that.forum_id,
                }).then(function (ret) {
                    that.info = ret.data.data
                    that.share()
                })
            },
            share(){
                let that = this
                wx.ready(function () {
                    let link = "{$url}"
                    let title = that.info.title
                    let desc = that.info.desc
                    let img_thumb = that.info.img_thumb
                    wx.updateAppMessageShareData({
                        title: title, // 分享标题
                        desc: desc, // 分享描述
                        link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                        imgUrl: img_thumb, // 分享图标
                    })

                    wx.updateTimelineShareData({
                        title: title, // 分享标题
                        link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                        imgUrl: img_thumb, // 分享图标
                    })

                    wx.onMenuShareWeibo({
                        title: title, // 分享标题
                        desc: desc, // 分享描述
                        link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                        imgUrl: img_thumb, // 分享图标
                    });
                })
            },
        },
    })
</script>
</body>
</html>
